package com.zmj.framework.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zmj.framework.bean.Code;
import com.zmj.framework.bean.Codetype;
import com.zmj.framework.dao.CodeDao;
import com.zmj.framework.dao.CodetypeDao;
import com.zmj.framework.service.CodeManager;
import com.zmj.framework.util.PageController;
@Service
@Transactional
public class CodeManagerImpl implements CodeManager {
	@Autowired
	CodeDao codeDao;
	@Autowired
	CodetypeDao codetypeDao;

	public CodeManagerImpl() {
		this.codeDao = null;
		this.codetypeDao = null;
	}

	public List getCodetypes(Codetype codetype) throws Exception {
		return this.codetypeDao.getCodetypes(codetype);
	}

	public Codetype getCodetype(String dmlb) throws Exception {
		return this.codetypeDao.getCodetype(dmlb);
	}

	public List getCodes(String dmlb) throws Exception {
		return this.codeDao.getCodes(dmlb);
	}

	public int saveCodetype(Codetype codetype) throws Exception {
		return this.codetypeDao.saveCodetype(codetype);
	}

	public int removeCodetype(String dmlb) throws Exception {
		return this.codetypeDao.removeCodetype(dmlb);
	}

	public Code getCode(String dmlb, String dmz) throws Exception {
		return this.codeDao.getCode(dmlb, dmz);
	}

	public int removeCode(Code frmCode) throws Exception {
		return this.codeDao.removeCode(frmCode);
	}

	public int saveCode(Code code) throws Exception {
		return this.codeDao.saveCode(code);
	}

	public List getCodetypesByPageSize(Codetype codetype, PageController controller) throws Exception {
		return this.codetypeDao.getCodetypesByPageSize(codetype, controller);
	}
}